import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
	state: {
		token: '',
		userInfo: {},
	},
	mutations: {
		setUserInfo(state, v) {
			if (v) {
				state.userInfo = v;
			}
		},
		// 退出登录
		logout(state) {
			state.token = '';
			state.userInfo = {};
		},
	},
	actions: {

	}
})

export default store
